
//
//  PublicMarco.h
//  PropertyMananger
//
//  Created by bh on 16/12/20.
//  Copyright © 2016年 BH. All rights reserved.
//
#import <Availability.h>

#ifndef PublicMarco_h
#define PublicMarco_h

#ifndef __IPHONE_5_0
#warning "This project uses features only available in iOS SDK 5.0 and later."
#endif

/** 庞国峰本地 */
#define Server_IP @"http://192.168.3.123:8800"

/** 正式服务器地址 */
//#define Server_IP @"http://www.hongsino.cn:8800"

/** 灿波本地 */
//#define Server_IP @"http://192.168.3.254:96"


/**打包不输出打印**/
#ifdef DEBUG // 如果定义了DEBUG这个宏，说明是处在调试阶段
#define BHLog(...) NSLog(__VA_ARGS__);
#else // 不是调试阶段，是发布阶段
#define BHLog(...)
#endif

/**打印输出**/
#ifdef DEBUG
#   define DLog(fmt, ...) NSLog((@"%s [Line %d] " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__);
#else
#   define DLog(...)
#endif

//检测网络
#define BHCommonAppDelegate (AppDelegate *)[[UIApplication sharedApplication]delegate]

/** 打印方法 */
#define BHLogFunc BHLog(@"%s", __func__);

/** 屏幕高度 */
#define BHscreenH [UIScreen mainScreen].bounds.size.height

/** 屏幕宽度度 */
#define BHscreenW [UIScreen mainScreen].bounds.size.width

/**弱引用**/
#define WEAKSELF_MACRO __weak typeof(&*self) weakSelf = self;

/**字体大小**/
#define BHFont(v) [UIFont systemFontOfSize:v]

/**本地图片**/
#define IMG(name) [UIImage imageNamed:name]
//定义UIImage对象
#define IMAGE(imageName) [UIImage imageNamed:[NSString stringWithFormat:@"%@",imageName]]

/**各种尺寸设备**/
#define iPhone3_5 (BHscreenH==480)
#define iPhone4_0 (BHscreenH==568)
#define iPhone4_7 (BHscreenH==667)
#define iPhone5_5 (BHscreenH==736)

//X比例
#define  UIScreenWP [UIScreen mainScreen].bounds.size.width/320
#define  UIScreenHP [UIScreen mainScreen].bounds.size.height/568

/** 主题色 */
#define Theme_Color [UIColor colorWithRed:0/255.0 green:170/255.0 blue:255/255.0 alpha:1]

/** RGB颜色 */
#define BHColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
/** 灰色 */
#define BHGrayColor BHColor(238, 238, 238)
/** 随机色 */
#define BHRandColor BHColor(arc4random_uniform(255), arc4random_uniform(255), arc4random_uniform(255))

// 1.判断是否为iOS7
#define iOS7 ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)
#define iOS7S ([[UIDevice currentDevice].systemVersion doubleValue] <= 7.0)
//系统版本
#define IS_IOS_VERSION   floorf([[UIDevice currentDevice].systemVersion floatValue]

#define IS_IOS_5    floorf([[UIDevice currentDevice].systemVersion floatValue]) ==5.0 ? 1 : 0

#define IS_IOS_6    floorf([[UIDevice currentDevice].systemVersion floatValue]) ==6.0 ? 1 : 0

#define IS_IOS_7    floorf([[UIDevice currentDevice].systemVersion floatValue]) ==7.0 ? 1 : 0

#define IS_IOS_8    floorf([[UIDevice currentDevice].systemVersion floatValue]) ==8.0 ? 1 : 0

#define IS_IOS_9    floorf([[UIDevice currentDevice].systemVersion floatValue]) ==9.0 ? 1 : 0

//加密 Key
#define Key @"pass@160"
//记住密码
#define RemberPassword @"RemberPassword"
//账号
#define Account @"account"
//密码
#define Password @"password"
//自动登录
#define AutoLogin @"autoLogin"

//用于判断是否为推送界面跳转
#define Push @"push"

//手机屏幕关闭或home键关闭程序通知名
#define ExitProgramNoticeCenter @"ExitProgramNoticeCenter"
//手机屏幕关闭或home键关闭程序再次打开程序通知名
#define EnterProgramNoticeCenter @"EnterProgramNoticeCenter"

#endif /* PublicMarco_h */
